<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box">

    </div>
    <script src="js/jquery.js"></script>
    <script>
        let showBtn = true;
        if(showBtn){
            let btn = $("<button>click me</button>");
            btn.on("click",function(){
                console.log("点击了");
            })
            $("#box").append(btn);
        }
    </script>
</body>
</html>